<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<c:set var="ctxStatic" value="${pageContext.request.contextPath}/static" />
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>登录</title>
<link href="${ctxStatic}/jqmobile/1.3.2/jquery.mobile-1.3.2.min.css"
	rel="stylesheet">
<script src="${ctxStatic}/jquery/1.10.2/jquery.min.js"></script>
<script src="${ctxStatic}/jqmobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		
		$("form:first").submit(function(){
			$("#tip").remove();
			var $tmp = $("<font color=\"red\" id=\"tip\"></font>");
			var regMobile=/^(1[0-9]{10})$/g;
			if($.trim($("#iptOA").val()) == ''){
				$("#headerdiv").after($tmp.append("请输入OA账号!"));
				$("#iptOA").focus();
				return false;
			}else if($.trim($("#iptName").val()) == ''){
				$("#headerdiv").after($tmp.append("请输入姓名!"));
				$("#iptName").focus();
				return false;
			}else if(!regMobile.test($("#iptMobile").val())){
				$("#headerdiv").after($tmp.append("请输入正确的手机号码!"));
				$("#iptMobile").focus();
				return false;
			}
		});/*end $("form:first").submit */
		
	});
</script>
</head>

<body>
	<div data-role="page">

		<div data-role="header" data-theme="b" data-position="fixed" id="headerdiv">
			<h1>登录</h1>
		</div><!-- /header -->
		
		<c:if test="${msg ne null }">
				<h3><font color="red" id="tip">${msg }</font></h3>
		</c:if>
		
		<form action="${ctx}/binding" id="form" method="post">
			<div data-role="content">
				<ul data-role="listview" data-inset="true">
					
					<input type="hidden" name="hdnOpenid" value="${openid}">
					<li data-role="fieldcontain">
						<!-- <label for="iptOA">OA账号</label> -->
						<input id="iptOA" name="iptOA" placeholder="请输入海南电网内部系统OA账号">
					</li>
					<li data-role="fieldcontain">
						<input id="iptName" name="username" placeholder="请输入姓名">
					</li>
					<li data-role="fieldcontain">
						<!-- <label for="iptMobile">手机号码</label> -->
						<input id="iptMobile" name="iptMobile" placeholder="请输入手机号码">
					</li>
					<li data-role="fieldcontain">
						<input value="绑  定" type="submit" data-icon="star" data-theme="b" id="btnLogin">
					</li>
					<li data-role="fieldcontain">
						<font color="blue">尊敬的用户，为了保障信息的安全，此项业务需要对您在海南电网OA系统中记录的账号和手机号码进行绑定。本业务涉及的内容及链接由海南电力技术研究院及微信共同为您提供。</font>
					</li>
				</ul>
			</div>
		<!-- /content -->
		</form>
		
		<!-- <div data-role="footer" data-theme="b" data-position="fixed">
			<h4>海南电研院&copy;2013</h4>
		</div> -->
		<!-- /footer -->

	</div>
	<!-- /page -->

</body>
</html>
